package yijy.company;

/**
 * Created by yijy on 2017/5/4.
 */
public class ResponsiveUI extends Thread{

    public static  volatile double d =1;

    public ResponsiveUI(){
      setDaemon(true);
      start();
    }

    @Override
    public void run() {
        while (true){
            d = d + (Math.PI + Math.E)/d;
        }
    }

    public static void main(String[] args) throws Exception{
//        new UnResponsiveUI();
        new ResponsiveUI();
        System.in.read();
        System.out.println(d);
    }
}

class UnResponsiveUI{

    private volatile double d =1;

    public UnResponsiveUI() throws Exception{
        while (d>0){
            d = d + (Math.PI + Math.E)/d;
        }
        System.in.read();
    }
}
